﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace NCLCustomerManagement.DataTransferObjects.Product
{
   
    public partial class ProductDTO : INotifyPropertyChanging, INotifyPropertyChanged
    {

        private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

        private int _Id;

        private string _ProductName;

        private string _Madein;

        private string _Description;

        private string _PrimaryUnit;

        private string _SecondaryUnit;

        private decimal _CurrentSaleUnitPrice;

        private double _QuantityPerUnit;

        private bool _Available;

        private double _UsedPerDay;

        private string _ImageUrl;

        private System.Nullable<int> _ProductCategoryId;

      

        #region Extensibility Method Definitions
        partial void OnLoaded();
        partial void OnValidate(System.Data.Linq.ChangeAction action);
        partial void OnCreated();
        partial void OnIdChanging(int value);
        partial void OnIdChanged();
        partial void OnProductNameChanging(string value);
        partial void OnProductNameChanged();
        partial void OnMadeinChanging(string value);
        partial void OnMadeinChanged();
        partial void OnDescriptionChanging(string value);
        partial void OnDescriptionChanged();
        partial void OnPrimaryUnitChanging(string value);
        partial void OnPrimaryUnitChanged();
        partial void OnSecondaryUnitChanging(string value);
        partial void OnSecondaryUnitChanged();
        partial void OnCurrentSaleUnitPriceChanging(decimal value);
        partial void OnCurrentSaleUnitPriceChanged();
        partial void OnQuantityPerUnitChanging(double value);
        partial void OnQuantityPerUnitChanged();
        partial void OnAvailableChanging(bool value);
        partial void OnAvailableChanged();
        partial void OnUsedPerDayChanging(double value);
        partial void OnUsedPerDayChanged();
        partial void OnImageUrlChanging(string value);
        partial void OnImageUrlChanged();
        partial void OnProductCategoryIdChanging(System.Nullable<int> value);
        partial void OnProductCategoryIdChanged();
        #endregion

        public ProductDTO()
        {
            
            OnCreated();
        }

        public int Id
        {
            get
            {
                return this._Id;
            }
            set
            {
                if ((this._Id != value))
                {
                    this.OnIdChanging(value);
                    this.SendPropertyChanging();
                    this._Id = value;
                    this.SendPropertyChanged("Id");
                    this.OnIdChanged();
                }
            }
        }

        public string ProductCategoryName { get; set; }
        public string ProductName
        {
            get
            {
                return this._ProductName;
            }
            set
            {
                if ((this._ProductName != value))
                {
                    this.OnProductNameChanging(value);
                    this.SendPropertyChanging();
                    this._ProductName = value;
                    this.SendPropertyChanged("ProductName");
                    this.OnProductNameChanged();
                }
            }
        }

        public string Madein
        {
            get
            {
                return this._Madein;
            }
            set
            {
                if ((this._Madein != value))
                {
                    this.OnMadeinChanging(value);
                    this.SendPropertyChanging();
                    this._Madein = value;
                    this.SendPropertyChanged("Madein");
                    this.OnMadeinChanged();
                }
            }
        }

        public string Description
        {
            get
            {
                return this._Description;
            }
            set
            {
                if ((this._Description != value))
                {
                    this.OnDescriptionChanging(value);
                    this.SendPropertyChanging();
                    this._Description = value;
                    this.SendPropertyChanged("Description");
                    this.OnDescriptionChanged();
                }
            }
        }

        public string PrimaryUnit
        {
            get
            {
                return this._PrimaryUnit;
            }
            set
            {
                if ((this._PrimaryUnit != value))
                {
                    this.OnPrimaryUnitChanging(value);
                    this.SendPropertyChanging();
                    this._PrimaryUnit = value;
                    this.SendPropertyChanged("PrimaryUnit");
                    this.OnPrimaryUnitChanged();
                }
            }
        }

        public string SecondaryUnit
        {
            get
            {
                return this._SecondaryUnit;
            }
            set
            {
                if ((this._SecondaryUnit != value))
                {
                    this.OnSecondaryUnitChanging(value);
                    this.SendPropertyChanging();
                    this._SecondaryUnit = value;
                    this.SendPropertyChanged("SecondaryUnit");
                    this.OnSecondaryUnitChanged();
                }
            }
        }

        public decimal CurrentSaleUnitPrice
        {
            get
            {
                return this._CurrentSaleUnitPrice;
            }
            set
            {
                if ((this._CurrentSaleUnitPrice != value))
                {
                    this.OnCurrentSaleUnitPriceChanging(value);
                    this.SendPropertyChanging();
                    this._CurrentSaleUnitPrice = value;
                    this.SendPropertyChanged("CurrentSaleUnitPrice");
                    this.OnCurrentSaleUnitPriceChanged();
                }
            }
        }

        public double QuantityPerUnit
        {
            get
            {
                return this._QuantityPerUnit;
            }
            set
            {
                if ((this._QuantityPerUnit != value))
                {
                    this.OnQuantityPerUnitChanging(value);
                    this.SendPropertyChanging();
                    this._QuantityPerUnit = value;
                    this.SendPropertyChanged("QuantityPerUnit");
                    this.OnQuantityPerUnitChanged();
                }
            }
        }

        public bool Available
        {
            get
            {
                return this._Available;
            }
            set
            {
                if ((this._Available != value))
                {
                    this.OnAvailableChanging(value);
                    this.SendPropertyChanging();
                    this._Available = value;
                    this.SendPropertyChanged("Available");
                    this.OnAvailableChanged();
                }
            }
        }

        public double UsedPerDay
        {
            get
            {
                return this._UsedPerDay;
            }
            set
            {
                if ((this._UsedPerDay != value))
                {
                    this.OnUsedPerDayChanging(value);
                    this.SendPropertyChanging();
                    this._UsedPerDay = value;
                    this.SendPropertyChanged("UsedPerDay");
                    this.OnUsedPerDayChanged();
                }
            }
        }

        public string ImageUrl
        {
            get
            {
                return this._ImageUrl;
            }
            set
            {
                if ((this._ImageUrl != value))
                {
                    this.OnImageUrlChanging(value);
                    this.SendPropertyChanging();
                    this._ImageUrl = value;
                    this.SendPropertyChanged("ImageUrl");
                    this.OnImageUrlChanged();
                }
            }
        }

        public System.Nullable<int> ProductCategoryId
        {
            get
            {
                return this._ProductCategoryId;
            }
            set
            {
                if ((this._ProductCategoryId != value))
                {
                   
                    this.OnProductCategoryIdChanging(value);
                    this.SendPropertyChanging();
                    this._ProductCategoryId = value;
                    this.SendPropertyChanged("ProductCategoryId");
                    this.OnProductCategoryIdChanged();
                }
            }
        }

        

        public event PropertyChangingEventHandler PropertyChanging;

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void SendPropertyChanging()
        {
            if ((this.PropertyChanging != null))
            {
                this.PropertyChanging(this, emptyChangingEventArgs);
            }
        }

        protected virtual void SendPropertyChanged(String propertyName)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

       
    }
}
